﻿using System;

namespace RefLib.Branding
{
    internal class BrandedObjectDTO
    {
        public int ID { get; set; }
        public string ObjectType { get; set; }
        public string Tag { get; set; }
        public string SubTag { get; set; }
        public string ResourceId { get; set; }
        public string Brand { get; set; }
        public int ContentLength { get; set; }

        public string MimeType { get; set; }
        public byte[] Blob { get; set; }
        public Nullable<Guid> BlobGuid { get; set; }
        public string Text { get; set; }
        public string TypeName { get; set; }
        public string SerializedValue { get; set; }

        public BlobModel ToBlobModel()
        {
            return new BlobModel()
                {
                    Blob = Blob,
                    BlobGuid = BlobGuid.Value,
                    BlobId = ID,
                    Brand = Brand,
                    ContentLength = ContentLength,
                    MimeType = MimeType,
                    ResourceId = ResourceId,
                    SubTag = SubTag,
                    Tag = Tag
                };
        }
    }
}
